//封装泛型
function returnItem<T>(arg:T):T{
	return arg
}
console.log(returnItem<string>('word'));

//2-1 需求：封装函数，传入[7，'seven']，返回['seven',7]
function swap1(arg:[number,string]):[string,number]{
	return [arg[1],arg[0]]
}
function swap<T,U>(arg:[T,U]):[U,T]{
	return [arg[1],arg[0]]
}
console.log(swap<number,string>([7,'seven']));